<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
 */

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::middleware(['check.api.auth'])->group(
    function () {
        //用户
        Route::post('signup', 'WechatUserController@signup');
        Route::post('login', 'WechatUserController@login');
        Route::any('makeidbarcode', 'WechatUserController@makeBarcode');
        Route::any('sendcode', 'WechatUserController@sendRandCode');
        Route::any('userupdatetele', 'WechatUserController@updateTele');
        Route::any('userupdateinfo', 'WechatUserController@updateInfo');
        Route::any('usergetinfo', 'WechatUserController@getUserInfo');
        Route::any('usergetinfosample', 'WechatUserController@getUserInfoSample');
        Route::any('usergetmyranking', 'WechatUserController@getMyRanking');
        Route::any('usergetranking', 'WechatUserController@getUserRanking');
        Route::any('userupdatestatus', 'WechatUserController@updateStatus');

        //广告
        Route::any('adlist', 'AdController@getAdList');
        Route::any('advertisementdetailinfo', 'AdvertisementDetailController@getInfo');

        //城市列表
        Route::any('getactivecity', 'OpenCityController@getActiveCity');
        Route::any('getopencitylist', 'OpenCityController@getOpenCityList');
        Route::any('getlivecity', 'CityListController@getLiveCity');
        Route::any('getcityinfo', 'CityListController@getCityInfo');
        Route::any('arealist', 'CityListController@getArea');
        Route::any('arealistbychild', 'CityListController@getAreaByChild');

        //挑战赛
        Route::any('challengelist', 'ChallengeGameController@list');
        Route::any('challengeinfo', 'ChallengeGameController@info');
        Route::any('mychallengelist', 'ChallengeGameController@myGamePerson');
        Route::any('startchallenge', 'ChallengeGameController@startGame');
        Route::any('scorechallenge', 'ChallengeGameController@setScore');
        Route::any('resetscorechallenge', 'ChallengeGameController@resetScore');
        Route::any('abnormalchallenge', 'ChallengeGameController@setAbnormal');
        Route::any('hasgame', 'ChallengeGameController@hasGame');

        //挑战赛详情
        Route::any('challengedetailinfodetail', 'ChallengeGameDetailController@getInfoAndDetail');
        Route::any('challengedetailinfo', 'ChallengeGameDetailController@getInfo');
        Route::any('challengedetailsetscore', 'ChallengeGameDetailController@setScore');
        Route::any('challengedetailsetdesc', 'ChallengeGameDetailController@setDesc');

        //锦标赛
        Route::any('championshiplist', 'ChampionshipController@list');
        Route::any('championshipinfo', 'ChampionshipController@info');
        Route::any('championshipstartgame', 'ChampionshipController@startGame');
        Route::any('championshipusersignup', 'ChampionshipUserController@signup');
        Route::any('championshiplistuser', 'ChampionshipController@getChampionshipByUser');
        Route::any('championshipusersignuplist', 'ChampionshipUserController@signupList');

        //擂台赛
        Route::any('arenacontestlist', 'ArenacontestController@list');
        Route::any('arenacontestinfo', 'ArenacontestController@info');
        Route::any('arenaconteststartgame', 'ArenacontestController@startGame');
        Route::any('arenacontestusersignup', 'ArenacontestUserController@signup');
        Route::any('arenacontestlistuser', 'ArenacontestController@getArenacontestByUser');
        Route::any('arenacontestusersignuplist', 'ArenacontestUserController@signupList');
        Route::any('arenacontestuserignupsubmit', 'ArenacontestUserController@signupSubmit');
        Route::any('arenacontestuserpay', 'ArenacontestUserController@pay');

        //头条
        Route::any('newsletterlist', 'NewsletterController@list');

        //挑战预约
        Route::any('cancelreservation', 'ReservationController@cancelGame');
        Route::any('rejectreservation', 'ReservationController@rejectGame');
        Route::any('reservationlist', 'ReservationController@list');
        Route::any('startreservation', 'ReservationController@start');
        Route::any('reservationinfo', 'ReservationController@info');
        Route::any('myreservationlist', 'ReservationController@myList');
        Route::any('applyreservation', 'ReservationController@applyGame');
        Route::any('abnormalreservation', 'ReservationController@setAbnormal');

        //门派
        Route::any('sectlist', 'SectController@list');
        Route::any('sectnew', 'SectController@new');
        Route::any('sectjoin', 'SectController@join');
        Route::any('sectinfo', 'SectController@info');
        Route::any('sectsave', 'SectController@save');
        Route::any('sectbarcode', 'SectController@getBarcode');
        Route::any('sectgetmyranking', 'SectController@getMyRanking');
        Route::any('sectgetranking', 'SectController@getSectRanking');
        Route::any('sectchangename', 'SectController@changeName');
        Route::any('sectnearby', 'SectController@getNearby');

        Route::any('findsectbyuser', 'SectMemberController@findSectByUser');
        Route::any('sectmemberlist', 'SectMemberController@memberList');
        Route::any('sectmemberleave', 'SectMemberController@leave');
        Route::any('sectmemberinfo', 'SectMemberController@info');
        Route::any('sectmembersave', 'SectMemberController@save');

        Route::any('legendlist', 'LegendController@list');
        Route::any('legendinfo', 'LegendController@info');
        //随机广告
        Route::any('randadinfo', 'RandAdController@getRandAd');
        Route::any('sectmembergetplaysect', 'SectMemberController@getPlaySect');
        //关注与取关
        Route::any('subscribesub', 'SubscribeController@sub');
        Route::any('subscribecan', 'SubscribeController@can');
        Route::any('subscribesublist', 'SubscribeController@subList');
        Route::any('subscribefanlist', 'SubscribeController@fanList');
        //分享
        Route::any('shareapp', 'ShareController@shareApp');
        //反馈FeedbackController
        Route::any('feedbacknew', 'FeedbackController@new');
        //攻略
        Route::any('raider', 'RaiderController@get');
        Route::any('sectraider', 'RaiderController@getSectRaider');
        //分享标题
        Route::any('sharetitle', 'ShareTitleController@getTitle');
        //红包
        Route::any('luckmoneyconfirm', 'LuckMoneyController@confirm');
        Route::any('luckmoneyamount', 'LuckMoneyController@getAmount');
        Route::any('luckmoneylist', 'LuckMoneyController@getLuckMoneyList');
        Route::any('withdrawlist', 'WithdrawController@getWithdrawList');
        Route::any('withdrawtime', 'WithdrawController@getWithdrawTime');
        Route::any('withdrawconfig', 'WithdrawController@getConfig');
        Route::any('withdrawapply', 'WithdrawController@apply');

        //上傳圖片
        Route::any('uploadfile', 'UploadsController@uploadFile');

        //打赏
        Route::any('rewardlist', 'RewardController@list');
        Route::any('rewardlistbysend', 'RewardController@listBySend');
        Route::any('reward', 'RewardController@reward');
        Route::any('rewardinfo', 'RewardController@info');

        //留言
        Route::any('messagelistbyreceive', 'MessageController@listByReceive');
        Route::any('messagelistbysend', 'MessageController@listBySend');
        Route::any('messagesend', 'MessageController@sendMsg');

        //门派公告
        Route::any('sectnoticelist', 'SectNoticeController@list');
        Route::any('sectnoticepublish', 'SectNoticeController@publish');

        //头条
        Route::any('reportlist', 'ReportController@list');
        Route::any('reportinfo', 'ReportController@info');

        //获取乒乓币
        Route::any('firstlogin', 'MissionController@fistLogin');

        //微信支付

        //活跃排行提示
        Route::any('rankingtips', 'RankingTipsController@info');
        //小程序设置
        Route::any('wechatuserprivacy', 'WechatUserPrivacyController@info');

        //足迹
        Route::any('footprintList', 'FootprintController@browseList');
        Route::any('browseFootprint', 'FootprintController@browse');
        Route::any('delFootprint', 'FootprintController@del');

        //设置
        Route::any('settinginfo', 'SettingController@info');

    }
);
Route::group([],
    function () {
        Route::any('test', 'TestController@test');
        //支付回调
        Route::any('callback', 'Wechat\PayController@callback')->name('wechat.pay.callback');
        Route::any('signupcallback', 'ArenacontestUserController@signupcallback')->name('wechat.pay.signupcallback');
        Route::any('wechatpay', 'Wechat\PayController@pay');
        Route::any('getWechatUserList', 'ArenacontestController@getWechatUserList');


    }
);
